#{extends 'orgLead.html'/}
<form action="@{Application.createIdea()}">
<p>&nbsp;</p>
&nbsp;<input name="submit" type="submit" value="Create idea"></form>
</form>

<form action="@{Application.createDraft}">
&nbsp;<input name="draft" type="submit" value="Create draft"></form>
</form>

  <div class="post">
        <form method="post">
  <h2 class="post-title">&nbsp;</h2>
  <h2 class="post-title">
            <a href="#">${top.title}</a>
        </h2>
        <div class="post-metadata">
            <span class="post-author">by ${top.user.nickName}</span>
            <span class="post-date">${top.pDate.format('MMM dd')}</span>
            <span class="post-comments">
                &nbsp;|&nbsp; 
                ${top.ideas.size() ?: 'no'} 
                Idea${top.ideas.size().pluralize()}
            </span><span class="post-author"> &nbsp;|&nbsp; 
            Tagged ${top.tag.tag}</span>
        </div><a href="@{Application.addTopicTag(top.id, dep.id)}">Tag This Topic </a>
        <div class="post-content">
           <label style="size:auto;">${top.content}</label> 
        </div>
    </div>
    <div class="comments">
        <h3>
            ${top.ideas.size() ?: 'no'} 
            idea${top.ideas.size().pluralize()}
        </h3>
        
        #{list items:top.ideas, as:'comment'}
            <div class="comment">
                <div class="comment-metadata">
                    <span class="comment-author">by ${comment.author.nickName},</span>
                    <span class="comment-date">
                        ${comment.atDate.format('dd MMM yy')}
                    </span>
                </div>
                <div class="comment-content">
                    ${comment.content.escape()}
                </div div class="comment-tags">
                    Tagged ${comment.tag.tag}
                </div>#{if comment.author.id == curUser}
                    <a href ="@{Application.addIdeaTag(comment.id, top.id, dep.id)}" >Tag</a>
                    #{/if}
     <a href="@{Application.report()}">Report</a> <br/>
     <a href="@{Application.share(comment.id)}">Share</a> <br/>
                <br>
            </div>
        #{/list}
    


<br><b></b><br><br><br><br><br><br><br><br><br>

<a href="@{Application.RelationBetweenTopics(top.id, dep.id)}"> Set
 Relation </a>
<br />
<br />
<a href = "@{Application.viewDepartment(dep.id)}">Back to ${dep.name}</a>